home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 July / EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso / earkit / news / thor / rexx / cfgfido.thor < prev    next >
Text File  |  1998-05-24  |  5KB  |  128 lines

  1. /* $VER: CfgFIDO.thor 1.6 (5.1.97)
  2.  *
  3.  * External configuration for the FIDO bbstype.
  4.  *
  5.  * Script by: Magne Østlyngen, Ultima Thule Software.
  6.  */
  7.  
  8. parse arg argument
  9. options results
  10.  
  11. template = 'BBSNAME/A,CONFNAME/K,PUBSCREEN/K'
  12.  
  13. p=' 'address()' 'show('P',,);if pos(' THOR.',p)>0 then thorport=word(,
  14. substr(p,pos(' THOR.',p)),1);else do;say'No THOR port found!';exit 10;end
  15.  
  16. if ~show('p', 'BBSREAD') then do
  17.     address command
  18.         "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
  19.         "WaitForPort BBSREAD"
  20. end
  21.  
  22. address "BBSREAD"
  23.  
  24. READARGS template ARGS CMDLINE argument
  25. if rc ~= 0 then do
  26.     address(thorport)
  27.     REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"'
  28.     exit 5
  29. end
  30.  
  31. GETBBSDATA bbsname '"'ARGS.BBSNAME'"' stem BBSDATA
  32. if rc ~= 0 then do
  33.     address(thorport)
  34.     REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"'
  35.     exit 5
  36. end
  37.  
  38. address(thorport)
  39.  
  40. origin = ""
  41. uucpaddr = ""
  42. uucpname = ""
  43. password = ""
  44. forceintl = "NO"
  45. packnetmail = "NO"
  46. afname = ""
  47. afpasswd = ""
  48. showorigin = "NO"
  49. kludgebody = "NO"
  50.  
  51. if open(fil, BBSDATA.BBSPATH||'fido.config', R) then do
  52.     do while ~eof(fil)
  53.         ln = readln(fil)
  54.         if upper(word(ln, 1)) = "ORIGIN:" then origin = strip(delstr(ln, 1, 7))
  55.         if upper(word(ln, 1)) = "PASSWORD:" then password = strip(delstr(ln, 1, 9))
  56.         if upper(word(ln, 1)) = "FORCEINTL:" then forceintl = strip(delstr(ln, 1, 10))
  57.         if upper(word(ln, 1)) = "PACKNETMAIL:" then packnetmail = strip(delstr(ln, 1, 12))
  58.         if upper(word(ln, 1)) = "UUCPADDRESS:" then uucpaddr = strip(delstr(ln, 1, 12))
  59.         if upper(word(ln, 1)) = "UUCPNAME:" then uucpname = strip(delstr(ln, 1, 9))
  60.         if upper(word(ln, 1)) = "AREAFIXNAME:" then afname = strip(delstr(ln, 1, 12))
  61.         if upper(word(ln, 1)) = "AREAFIXPASSWORD:" then afpasswd = strip(delstr(ln, 1, 16))
  62.         if upper(word(ln, 1)) = "SHOWORIGIN:" then showorigin = strip(delstr(ln, 1, 11))
  63.         if upper(word(ln, 1)) = "KLUDGEBODY:" then kludgebody = strip(delstr(ln, 1, 11))
  64.     end
  65.     call close(fil)
  66. end
  67.  
  68. if forceintl ~= "YES" & forceintl ~= "NO" then do
  69.     REQUESTNOTIFY TEXT '"Error in config: FORCEINTL neither YES nor NO.\n"' BT '"_Ok"'
  70. end
  71.  
  72. REQUESTSTRING TITLE '"Enter Origin:"' BODY '"The origin line is on the format:\n\n ** Origin <text> (<address>)\n\nWhere <text> is this text, and <address> is your fido-address."' BT '"_Ok|_Abort"' ID '"'||origin||'"' MAXCHARS 256
  73. if rc=30 then exit 10
  74. if rc=0 then origin = result
  75.  
  76. REQUESTNOTIFY TEXT '"Show origin lines?\n\nIf you enable this option, origin lines are added to\nthe message body.  If this option is disabled, the\norigin lines are added to the comment-text."' BT '"_Yes|_No"'
  77. if rc~=0 then exit 10
  78. if result = 1 then showorigin = "YES"; else showorigin = "NO"
  79.  
  80. REQUESTSTRING TITLE '"Enter Password:"' BODY '"This is the password that is\nput into the reply-packets\n(NOT the password in areafix messages!)"' BT '"_Ok|_Abort"' ID '"'||password||'"' MAXCHARS 8
  81. if rc=30 then exit 10
  82. if rc=0 then password = result
  83.  
  84. REQUESTNOTIFY TEXT '"Force INTL lines?\n\nIf you experience problems with your netmail\nnot coming to the receiver, try setting \nthis to yes."' BT '"_Yes|_No"'
  85. if rc~=0 then exit 10
  86. if result = 1 then forceintl = "YES"; else forceintl = "NO"
  87.  
  88. REQUESTNOTIFY TEXT '"Add kludges in comment or mesage body?"' BT '"_Comment|_Body"'
  89. if rc~=0 then exit 10
  90. if result = 1 then kludgebody = "NO"; else kludgebody = "YES"
  91.  
  92. REQUESTNOTIFY TEXT '"Pack netmail?\n\nShould messages written in NetMail.#? also be archived?"' BT '"_Yes|_No"'
  93. if rc~=0 then exit 10
  94. if result = 1 then packnetmail = "YES"; else packnetmail = "NO"
  95.  
  96. REQUESTSTRING TITLE '"Enter UUCP address:"' BODY '"This is the address of the gateway to send internet messages through"' BT '"_Ok|_Abort"' ID '"'||uucpaddr||'"' MAXCHARS 256
  97. if rc=30 then exit 10
  98. if rc=0 then uucpaddr = result
  99.  
  100. REQUESTSTRING TITLE '"Enter UUCP name:"' BODY '"This is the name of the UUCP gateway"' BT '"_Ok|_Abort"' ID '"'||uucpname||'"' MAXCHARS 256
  101. if rc=30 then exit 10
  102. if rc=0 then uucpname = result
  103.  
  104. REQUESTSTRING TITLE '"Enter areafix name:"' BODY '"This is the name of Areafix\nDefault is '||"'"||'areafix'||"'"||'"' BT '"_Ok|_Abort"' ID '"'||afname||'"' MAXCHARS 70
  105. if rc=30 then exit 10
  106. if rc=0 then afname = result
  107.  
  108. REQUESTSTRING TITLE '"Enter areafix password:"' BODY '"This is the password to put in areafix messages"' BT '"_Ok|_Abort"' ID '"'||afpasswd||'"' MAXCHARS 31
  109. if rc=30 then exit 10
  110. if rc=0 then afpasswd = result
  111.  
  112.  
  113. if open(fil, BBSDATA.BBSPATH||'fido.config', W) then do
  114.     if origin ~= "" then call writeln(fil, "ORIGIN: "||origin)
  115.     if password ~= "" then call writeln(fil, "PASSWORD: "||password)
  116.     if forceintl ~= "NO" then call writeln(fil, "FORCEINTL: "||forceintl)
  117.     if kludgebody ~= "NO" then call writeln(fil, "KLUDGEBODY: "||kludgebody)
  118.     if showorigin ~= "NO" then call writeln(fil, "SHOWORIGIN: "||showorigin)
  119.     if packnetmail ~= "NO" then call writeln(fil, "PACKNETMAIL: "||packnetmail)
  120.     if uucpaddr ~= "" then call writeln(fil, "UUCPADDRESS: "||uucpaddr)
  121.     if uucpname ~= "" then call writeln(fil, "UUCPNAME: "||uucpname)
  122.     if afname ~= "" then call writeln(fil, "AREAFIXNAME: "||afname)
  123.     if afpasswd ~= "" then call writeln(fil, "AREAFIXPASSWORD: "||afpasswd)
  124.     call close(fil)
  125. end
  126.  
  127. exit 0
  128.